package wclg;
public class class_60 {
    public static void fun(int []arr,int len){
        for (int i = 0; i <arr.length/2; i++) {
            int tmp = arr[i];
            arr[i] = arr[arr.length-1-i];
            arr[arr.length-1-i] = tmp;
        }
    }
    public static void main(String[] args) {
        int []arr={1,2,3,4,5};
        System.out.println("交换前:");
        for (int i = 0; i < arr.length; i++) {
            System.out.printf("%d ",arr[i]);
        }
        System.out.println("\n");
        System.out.println("交换后:");
        fun(arr,arr.length);
        for (int i = 0; i < arr.length; i++) {
            System.out.printf("%d ",arr[i]);
        }
    }
}
